import org.omg.CORBA.*;
import org.omg.CosNaming.*;

public class MyServerClient
{
	public static void main(String args[])
	{
		//String sor = null;
		//if(args.length > 0)
		//sor = args[0];
		//else
		//{
		//	System.out.println("You have forgotten the object reference...");
		//	System.exit(1);
		//}
		try
		{
			ORB myORB = ORB.init(args,null);
			
			org.omg.CORBA.Object objRef = null;//myORB.string_to_object(sor);
			
			objRef = myORB.resolve_initial_references("NameService");
		
		NamingContext namecon = NamingContextHelper.narrow(objRef);			
		NameComponent toNc = new NameComponent("MyServer","");
		//NameComponent subNc = new NameComponent("Naming1","");
		NameComponent path[] = {toNc};//,subNc};
		//MyServer ser = MyServerHelper.narrow();
		//	org.omg.CORBA.Object ref2 = nameContext.resolve(path);
		//	NamingContext nameContext2 = NamingContextHelper.narrow(ref2);
		//	System.out.println("Got Secondary naming Context..");
		org.omg.CORBA.Object oref = namecon.resolve(path);	
		
		
		MyServer se = MyServerHelper.narrow(oref);
		se.quesFile("Rabbi");
		se.examTime("Pavel");
		se.quesAnsw("Saif");
		se.answSubm("Asif");
		}
		catch(Exception e)
		{
			System.out.println("Error..");
			e.printStackTrace();
		}
			
	}
	
		
}

	